require "rake/testtask"
require "rspec/core/rake_task"

$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew"))
$LOAD_PATH.unshift(File.expand_path("../lib", __FILE__))

namespace :test do
  namespace :coverage do
    desc "Upload coverage to Codecov"
    task :upload do
      require "simplecov"
      require "codecov"
      formatter = SimpleCov::Formatter::Codecov.new
      formatter.format(SimpleCov::ResultMerger.merged_result)
    end
  end
end

desc "Open a REPL for debugging and experimentation"
task :console do
  require "pry"
  require "pry-byebug"
  require "hbc"
  ARGV.clear
  Hbc.pry
end
